#include "getActorButton.h"
#include "input.h"
#include "renderer.h"


GetActorButton::GetActorButton(){
}

GetActorButton::~GetActorButton(){
}


void GetActorButton::clickedLeft(){

input->focusButton=this;
}

void GetActorButton::focusClick(){
Button::focusClick();

if (input->worldTarget)
    for (unsigned int i=0;i<renderer->actorList.size();i++)
      if (renderer->actorList[i]==input->worldTarget){
        if (buttonProperty!=""){
            memberID * mID = &(parent->property[buttonProperty]);
            setPropertyTo(mID,i);
            }
        else
            parent->trigger(this);
        }
}


void GetActorButton::create(){

renderer->addButton(this);
std::cout << "creating a getActorButton!";
}
